/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ac.za.cput.marks.Impl;

import ac.za.cput.marks.Marks;

/**
 *
 * @author Enkosi
 */
public class MarksImpl implements Marks{

    @Override
    public int highest(int []list) {
        int highest = list[0];
        
        for(int mark: list){
            if(mark > highest)
                highest = mark;
        }
        return highest;
    }

    @Override
    public int lowest(int []list) {
        int lowest = list[0];
        
        for(int mark: list){
            if(mark < lowest)
                lowest = mark;
        }
        return lowest;
    }

    @Override
    public double average(int []list) {
        double total = 0;
        
        for(int mark: list){
            total += mark;
        }
        return (double)total/list.length;
    }
    
}
